package com.lzy.system.organization.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lzy.exception.BusException;
import com.lzy.system.organization.dto.SysDepartmentDTO;
import com.lzy.system.organization.dto.SysDepartmentOrderDTO;
import com.lzy.system.organization.entity.SysDepartment;
import com.lzy.system.organization.vo.SysDepartmentVo;

import java.util.List;

/**
 * <p>
 * 部门 服务类
 * </p>
 *
 * @author lcc
 * @since 2023-11-22
 */
public interface ISysDepartmentService extends IService<SysDepartment> {
    /**
     * 新增部门
     * @param sysDepartmentDTO
     * @return
     * @throws Exception
     */
    public boolean add(SysDepartmentDTO sysDepartmentDTO) throws BusException;

    /**
     * 修改部门
     * @param sysDepartmentDTO
     * @return
     * @throws Exception
     */
    public boolean update(SysDepartmentDTO sysDepartmentDTO) throws BusException;

    /**
     * 删除部门 级联
     * @param sysDepartments
     * @return
     * @throws BusException
     */
    public boolean del(List<SysDepartment> sysDepartments) throws BusException;

    /**
     * 查询所有部门
     * @return
     * @throws BusException
     */
    public List<SysDepartment> getList() throws BusException;

    /**
     * 根据盘pid查询部门
     * @param pid
     * @return
     * @throws BusException
     */
    public List<SysDepartmentVo> getListByPid(Long pid,Integer companyId) throws BusException;

    /**
     * 保存排序
     * @param sysDepartmentOrderDTOS
     * @throws BusException
     */
    public void saveOrder(List<SysDepartmentOrderDTO> sysDepartmentOrderDTOS) throws BusException;
}
